from django.shortcuts import render

# Create your views here.
from django.shortcuts import render
from apps.massage_form.models import Message
from django.http import HttpResponse

def message_form(request):
    if request.method == 'POST':
        msg=Message()
        msg.name=request.POST.get('name')
        msg.email=request.POST.get('email')
        msg.address=request.POST.get('address')
        msg.message=request.POST.get('message')
        msg.save()



    return render(request,"message_form.html") # 一定要return 修改HTML文件后，可能需要重启才能出现效果
    # return HttpResponse('HAHHA')